/*
 * @Author: your name
 * @Date: 2021-04-19 10:57:33
 * @LastEditTime: 2021-05-31 15:54:52
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \complex\app\router\home.js
 */
"use strict";

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
  const { router, middleware } = app;
  const jwt = middleware.jwt({...app.config.jwt,whitelist:app.config.auth.whitelist});
  const auth = middleware.auth(app.config.auth);
  router.post(
    "/mq/send/:topic",
    jwt,
    auth,
    app.mqtt.controller.home.send
  );
  app.emqtt.route(
    "complex",
    jwt,
    auth,
    app.mqtt.controller.home.send
  );
};
